import request from '@/utils/nornamlrequest'

enum Api {
  list = '/plugins/scada-plugin/scada/stage/list',
  editlist = '/plugins/scada-plugin/scada/stage/edit',
  addStage = '/plugins/scada-plugin/scada/stage/add',
  delete = '/rule_engine/delete',
  resume = '/rule_engine/resume',
  pause = '/rule_engine/pause',
  logList = '/rule_engine/ruleLog/list',
  logClear = '/rule_engine/ruleLog/clear',
}
// 编辑规则
export const addStage = (data) => {
  return request({
    url: Api.addStage,
    method: 'post',
    data,
  })
}
// 获取列表
export const gettableauList = (data) => {
  return request({
    url: Api.list,
    method: 'get',
    data,
  })
}
// 编辑规则
export const editlistlist = (data) => {
  return request({
    url: Api.editlist,
    method: 'post',
    data,
  })
}
// 删除规则
export const deleteRule = (data) => {
  return request({
    url: Api.delete,
    method: 'post',
    data,
  })
}
// 停止
export const pauseRule = (data) => {
  return request({
    url: Api.pause,
    method: 'post',
    data,
  })
}

// 恢复
export const resumeRule = (data) => {
  return request({
    url: Api.resume,
    method: 'post',
    data,
  })
}

// 获取日志
export const getRulesLog = (data) => {
  return request({
    url: Api.logList,
    method: 'post',
    data,
  })
}
// 清空日志
export const clearRulesLog = (data) => {
  return request({
    url: Api.logClear,
    method: 'post',
    data,
  })
}
